﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Program.cs" company="Matthias Friedrich">
//   Copyright © Matthias Friedrich 2013
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace Sample2
{
    using System.Linq;

    using CommandlineHandling;

    internal class Program
    {
        // 	sample2.exe /add -v:1 -v:2
        private static void Main(string[] args)
        {
            var handler = new CommandLineHandler();

            handler.Register<AddOperation>("add");

            var arguments = handler.Parse(args);

            var add = arguments.Single(x => x is AddOperation);

            var result = (int)add.InvokeExecute(); // expected result: 3
        }
    }
}